AddCSLuaFile( "cl_init.lua" ) -- Make sure clientside
AddCSLuaFile( "shared.lua" )  -- and shared scripts are sent.

include('shared.lua')

postable = {}
postable[1] = Vector(111,222,333)
postable[2] = Vector(444,555,666)

local spawnpos = table.Random(postable)

function ENT:SpawnFunction( ply, tr )
    ent:SetPos( spawnpos )
    ent:Spawn()
    ent:Activate()

    return ent
end

function ENT:Initialize()

	self.Entity:SetModel( "models/props/cakeprop/cakeprop.mdl" )
	self.Entity:PhysicsInit( SOLID_VPHYSICS )      -- Make us work with physics,
	self.Entity:SetMoveType( MOVETYPE_VPHYSICS )   -- after all, gmod is a physics
	self.Entity:SetSolid( SOLID_VPHYSICS )         -- Toolbox
	self.Entity:SetUseType(SIMPLE_USE)

	local phys = self.Entity:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
	end


end

function ENT:Use( activator, caller )
    caller:PrintMessage( HUD_PRINTTALK , "Da cake vas a lie!" )
	self:Remove()
	caller:Kill()
end

function ENT:Think()

end
